package com.baidu.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

/**
 * 
 * @TableName tb_city
 */
@TableName(value ="tb_city")
public class TbCity implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer did;

    /**
     * 名称
     */
    private String dname;

    /**
     * 父id
     */
    private Integer pid;

    /**
     * 城市等级
     */
    private Integer level;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    public Integer getDid() {
        return did;
    }

    /**
     * 
     */
    public void setDid(Integer did) {
        this.did = did;
    }

    /**
     * 名称
     */
    public String getDname() {
        return dname;
    }

    /**
     * 名称
     */
    public void setDname(String dname) {
        this.dname = dname;
    }

    /**
     * 父id
     */
    public Integer getPid() {
        return pid;
    }

    /**
     * 父id
     */
    public void setPid(Integer pid) {
        this.pid = pid;
    }

    /**
     * 城市等级
     */
    public Integer getLevel() {
        return level;
    }

    /**
     * 城市等级
     */
    public void setLevel(Integer level) {
        this.level = level;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TbCity other = (TbCity) that;
        return (this.getDid() == null ? other.getDid() == null : this.getDid().equals(other.getDid()))
            && (this.getDname() == null ? other.getDname() == null : this.getDname().equals(other.getDname()))
            && (this.getPid() == null ? other.getPid() == null : this.getPid().equals(other.getPid()))
            && (this.getLevel() == null ? other.getLevel() == null : this.getLevel().equals(other.getLevel()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getDid() == null) ? 0 : getDid().hashCode());
        result = prime * result + ((getDname() == null) ? 0 : getDname().hashCode());
        result = prime * result + ((getPid() == null) ? 0 : getPid().hashCode());
        result = prime * result + ((getLevel() == null) ? 0 : getLevel().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", did=").append(did);
        sb.append(", dname=").append(dname);
        sb.append(", pid=").append(pid);
        sb.append(", level=").append(level);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}